/*
// 用户行为监控服务 - 已注释
// 如需重新启用，请取消注释

import api from '@/utils/api'

/**
 * 用户行为监控服务
 */
class UserBehaviorService {
  constructor() {
    this.currentSession = null
    this.actionQueue = []
    this.isTracking = false
  }

  /**
   * 生成会话ID
   */
  generateSessionId() {
    const timestamp = Date.now()
    const random = Math.random().toString(36).substring(2, 11)
    return `session_${timestamp}_${random}`
  }

  /**
   * 跟踪用户行为
   */
  async trackAction(actionType, targetElement = null, additionalData = {}) {
    try {
      const trackingData = {
        sessionId: this.currentSession?.sessionId || '',
        actionType,
        taskDetailId: this.currentSession?.taskDetailId || null,
        patientId: this.currentSession?.patientId || null,
        actionData: {
          targetElement,
          timestamp: new Date().toISOString(),
          ...additionalData
        },
        pageUrl: window.location.href
      }

      console.log('跟踪用户行为:', trackingData)
      
      // 发送到后端
      await api.post('/api/UserBehavior/track', trackingData)
    } catch (error) {
      console.error('行为跟踪失败:', error)
    }
  }

  /**
   * 开始操作会话
   */
  async startSession(taskDetailId, patientId, patientName, phoneNumber) {
    try {
      const sessionId = this.generateSessionId()
      
      this.currentSession = {
        sessionId,
        taskDetailId,
        patientId,
        patientName,
        phoneNumber,
        startTime: new Date()
      }

      const sessionData = {
        sessionId,
        taskDetailId,
        patientId,
        patientName,
        phoneNumber
      }

      console.log('开始操作会话:', sessionData)
      
      // 发送到后端
      await api.post('/api/UserBehavior/start-session', sessionData)
      
      // 跟踪会话开始
      await this.trackAction('SESSION_START', 'session', { taskDetailId, patientId })
      
      return sessionId
    } catch (error) {
      console.error('开始会话失败:', error)
      throw error
    }
  }

  /**
   * 完成操作会话
   */
  async completeSession(contactResult, userNotes) {
    try {
      if (!this.currentSession) {
        console.warn('没有活动会话')
        return
      }

      const sessionData = {
        sessionId: this.currentSession.sessionId,
        contactResult,
        userNotes
      }

      console.log('完成操作会话:', sessionData)
      
      // 发送到后端
      await api.post('/api/UserBehavior/complete-session', sessionData)
      
      // 跟踪会话完成
      await this.trackAction('SESSION_COMPLETE', 'session', { 
        contactResult, 
        userNotes,
        duration: Date.now() - this.currentSession.startTime.getTime()
      })
      
      // 清除当前会话
      this.currentSession = null
    } catch (error) {
      console.error('完成会话失败:', error)
    }
  }

  /**
   * 跟踪查看详情
   */
  async trackViewDetails(taskId) {
    await this.trackAction('VIEW_DETAILS', 'details_button', { taskId })
  }

  /**
   * 跟踪查看电话
   */
  async trackViewPhone(phoneNumber) {
    await this.trackAction('VIEW_PHONE', 'phone_display', { phoneNumber })
  }

  /**
   * 跟踪复制电话
   */
  async trackCopyPhone(phoneNumber) {
    await this.trackAction('COPY_PHONE', 'copy_button', { phoneNumber })
  }

  /**
   * 跟踪输入备注
   */
  async trackInputNotes(content, charCount) {
    await this.trackAction('INPUT_NOTES', 'notes_input', { 
      content: content?.substring(0, 100), // 只记录前100个字符
      charCount 
    })
  }

  /**
   * 跟踪选择联系结果
   */
  async trackSelectResult(result) {
    await this.trackAction('SELECT_RESULT', 'result_select', { result })
  }

  /**
   * 跟踪保存联系记录
   */
  async trackSaveContact(contactResult, userNotes) {
    await this.trackAction('SAVE_CONTACT', 'save_button', { 
      contactResult, 
      userNotes: userNotes?.substring(0, 100) // 只记录前100个字符
    })
  }

  /**
   * 跟踪关闭对话框
   */
  async trackCloseDialog() {
    await this.trackAction('CLOSE_DIALOG', 'close_button')
  }

  /**
   * 跟踪页面焦点变化
   */
  async trackPageFocus() {
    await this.trackAction('PAGE_FOCUS', 'window')
  }

  /**
   * 跟踪页面失去焦点
   */
  async trackPageBlur() {
    await this.trackAction('PAGE_BLUR', 'window')
  }

  /**
   * 跟踪鼠标移动
   */
  async trackMouseMove(x, y) {
    // 限制鼠标移动事件的频率
    if (this.lastMouseMove && Date.now() - this.lastMouseMove < 1000) {
      return
    }
    this.lastMouseMove = Date.now()
    
    await this.trackAction('MOUSE_MOVE', 'document', { x, y })
  }

  /**
   * 跟踪按键
   */
  async trackKeyPress(key, target) {
    await this.trackAction('KEY_PRESS', target, { key })
  }

  /**
   * 初始化页面监听器
   */
  initPageListeners() {
    // 页面焦点事件
    window.addEventListener('focus', () => this.trackPageFocus())
    window.addEventListener('blur', () => this.trackPageBlur())
    
    // 鼠标移动事件（限制频率）
    document.addEventListener('mousemove', (e) => {
      this.trackMouseMove(e.clientX, e.clientY)
    })
    
    // 按键事件
    document.addEventListener('keydown', (e) => {
      this.trackKeyPress(e.key, e.target.tagName)
    })
  }

  /**
   * 获取当前会话信息
   */
  getCurrentSession() {
    return this.currentSession
  }

  /**
   * 清除当前会话
   */
  clearSession() {
    this.currentSession = null
  }

  /**
   * 获取会话分析结果
   */
  async getSessionAnalysis(sessionId) {
    try {
      const response = await api.get(`/api/UserBehavior/analyze/${sessionId}`)
      return response.data
    } catch (error) {
      console.error('获取会话分析失败:', error)
      return null
    }
  }

  /**
   * 获取可疑操作列表
   */
  async getSuspiciousOperations(startDate, endDate, userId = null) {
    try {
      const params = { startDate, endDate }
      if (userId) params.userId = userId
      
      const response = await api.get('/api/UserBehavior/suspicious', { params })
      return response.data
    } catch (error) {
      console.error('获取可疑操作失败:', error)
      return []
    }
  }

  /**
   * 获取用户每日统计
   */
  async getUserDailyStats(userId, date) {
    try {
      const response = await api.get(`/api/UserBehavior/daily-stats/${userId}`, {
        params: { date }
      })
      return response.data
    } catch (error) {
      console.error('获取用户统计失败:', error)
      return null
    }
  }
}

// 创建单例实例
const userBehaviorService = new UserBehaviorService()

// 初始化页面监听器
if (typeof window !== 'undefined') {
  userBehaviorService.initPageListeners()
}

export default userBehaviorService
*/

// 空的用户行为监控服务 - 禁用所有功能
class DisabledUserBehaviorService {
  constructor() {
    this.currentSession = null
  }

  // 所有方法都返回空或默认值，不执行任何操作
  generateSessionId() { return '' }
  async trackAction() { return Promise.resolve() }
  async startSession() { return Promise.resolve('') }
  async completeSession() { return Promise.resolve() }
  async trackViewDetails() { return Promise.resolve() }
  async trackViewPhone() { return Promise.resolve() }
  async trackCopyPhone() { return Promise.resolve() }
  async trackInputNotes() { return Promise.resolve() }
  async trackSelectResult() { return Promise.resolve() }
  async trackSaveContact() { return Promise.resolve() }
  async trackCloseDialog() { return Promise.resolve() }
  async trackPageFocus() { return Promise.resolve() }
  async trackPageBlur() { return Promise.resolve() }
  async trackMouseMove() { return Promise.resolve() }
  async trackKeyPress() { return Promise.resolve() }
  initPageListeners() { }
  getCurrentSession() { return null }
  clearSession() { }
  async getSessionAnalysis() { return Promise.resolve(null) }
  async getSuspiciousOperations() { return Promise.resolve([]) }
  async getUserDailyStats() { return Promise.resolve(null) }
}

// 导出禁用的服务
export default new DisabledUserBehaviorService()